{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}
{% import "_my_wtf_macros.html" as my_wtf_macros %}

{% block title %}万屏时代OPC--回应工程商列表{% endblock %}

{% block panel_heading %}
  万屏时代OPC--回应工程商列表
{% endblock %}

{% block panel_body %}
    <form id="search-call-order-form"
          action="{{ url_for('op_bp.sms_marketing_user_list') }}"
          method="post" class="form" role="form">
        {{ my_wtf_macros.form_field(form.sms_marketing_level, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.respond_datetime_begin, div_col=4, label_col=4, field_col=7) }}
        {{ my_wtf_macros.form_field(form.respond_datetime_end, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="pull-right btn-group">
            <span>
                <button type="submit" class="btn btn-info"
                        id="query-user-btn">
                查询
            </button>
            </span>
        </div>
    </form>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'op_bp.sms_marketing_user_list', **url_kwargs) }}
    </div>
    {% endif %}

    <table id="sms-marketing-user-table" class="table table-bordered table-hover table-condensed table-striped">
        <thead>
            <tr>
                <th>用户ID</th>
                <th>手机号</th>
                <th>昵称</th>
                <th>营销工程商分级</th>
                <th>回应时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {% for user in users %}
            <tr>
                <td><a href="{{url_for('op_bp.user_info', user_id=user.id)}}" target="_blank">{{ user.id }}</a></td>
                <td>{{ user.mobile | encrypt }}</td>
                <td>{{ user.nickname }}</td>
                <td>{{ user.sms_marketing_level_display }}</td>
                <td>{{ user.sms_marketing_respond_datetime }}</td>
                <td>
                    <a
                      class="btn btn-xs btn-primary"
                      href="{{url_for('op_bp.sms_marketing_user', user_id=user.id)}}"
                      name="respond-info"
                      target="_blank"
                    >回应详情</a><br>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'op_bp.sms_marketing_user_list', **url_kwargs) }}
    </div>
    {% endif %}

{% endblock %}

{% block scripts %}
{{ super() }}
{% endblock %}
